package hu;

import java.util.*;

public class Main3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] fee = new int[n];
        int[] dis = new int[n];
        for (int i = 0; i < n; i++) {
            fee[i] = sc.nextInt();
        }
        for (int i = 0; i < n; i++) {
            dis[i] = sc.nextInt();
        }
        int max_d = sc.nextInt();
        int[] dp = new int[n];
        dp[0] = fee[0];
        List<Integer> ans = new ArrayList<>();
        dfs(fee, dis, max_d, 1, dp);
        if(dp[n - 1] < 0){
            System.out.println(-1);
            return;
        }
        for (int i = 0; i < ans.size(); i++) {
            if(i != ans.size() - 1)
                System.out.print(ans.get(i) + " ");
            System.out.print(ans.get(i));
        }
    }
    public static void dfs(int[] fee, int[] dis, int max_d, int index, int[]dp){
        if(max_d <= 0 || index > dis.length)
            return;
        for (int i = 0; i < dis.length; i++) {

        }
    }

}
